package com.csproj.dispatch.service.dto;


import com.csproj.dispatch.util.DateJsonDeserializer;
import com.csproj.dispatch.util.WarnType;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import java.io.Serializable;
import java.time.ZonedDateTime;
import java.util.Objects;

/**
 * A DTO for the WarnInfo entity.
 */
@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
public class WarnInfoDTO implements Serializable {

    private String id;

    private String dispatchId;

    private String containerCode;

    private String lockCode;

    private String warnType;

    private String warnTypeName;

    private String msg;

    private String warnpostion;

    private String postionLng;

    private String postionLat;

    @JsonDeserialize(using = DateJsonDeserializer.class)
//    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8", locale = "zh")
    private ZonedDateTime warnTime;

    private Boolean handleFlag;

    private String noticestatus;

    @JsonDeserialize(using = DateJsonDeserializer.class)
//    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8", locale = "zh")
    private ZonedDateTime handleTime;

    private String handleUserId;

    private String handlereport;

    private Boolean deletedFlag;

    private String deleterUserId;

    @JsonDeserialize(using = DateJsonDeserializer.class)
//    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8", locale = "zh")
    private ZonedDateTime deletionTime;

    @JsonDeserialize(using = DateJsonDeserializer.class)
//    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8", locale = "zh")
    private ZonedDateTime lastModificationTime;

    private String lastModifierUserId;

    @JsonDeserialize(using = DateJsonDeserializer.class)
//    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8", locale = "zh")
    private ZonedDateTime creationTime;

    private String creatorUserId;

    //扩展 - 调度信息
    private String routeCode;//路径编号
    private String launchsiteName;//启运站点名称
    private String destinationsiteName;//目的站点名称
    private String handleUserName;//处理人
    private String transportCode;//车牌号


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getDispatchId() {
        return dispatchId;
    }

    public void setDispatchId(String dispatchId) {
        this.dispatchId = dispatchId;
    }

    public String getContainerCode() {
        return containerCode;
    }

    public void setContainerCode(String containerCode) {
        this.containerCode = containerCode;
    }

    public String getLockCode() {
        return lockCode;
    }

    public void setLockCode(String lockCode) {
        this.lockCode = lockCode;
    }

    public String getWarnType() {
        return warnType;
    }

    public void setWarnType(String warnType) {
        this.warnType = warnType;
        this.warnTypeName = WarnType.getName(Integer.valueOf(warnType));
    }

    public String getWarnTypeName() {
        return warnTypeName;
    }

    public void setWarnTypeName(String warnTypeName) {
        this.warnTypeName = warnTypeName;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public String getWarnpostion() {
        return warnpostion;
    }

    public void setWarnpostion(String warnpostion) {
        this.warnpostion = warnpostion;
    }

    public String getPostionLng() {
        return postionLng;
    }

    public void setPostionLng(String postionLng) {
        this.postionLng = postionLng;
    }

    public String getPostionLat() {
        return postionLat;
    }

    public void setPostionLat(String postionLat) {
        this.postionLat = postionLat;
    }

    public ZonedDateTime getWarnTime() {
        return warnTime;
    }

    public void setWarnTime(ZonedDateTime warnTime) {
        this.warnTime = warnTime;
    }

    public Boolean isHandleFlag() {
        return handleFlag;
    }

    public void setHandleFlag(Boolean handleFlag) {
        this.handleFlag = handleFlag;
    }

    public String getNoticestatus() {
        return noticestatus;
    }

    public void setNoticestatus(String noticestatus) {
        this.noticestatus = noticestatus;
    }

    public ZonedDateTime getHandleTime() {
        return handleTime;
    }

    public void setHandleTime(ZonedDateTime handleTime) {
        this.handleTime = handleTime;
    }

    public String getHandleUserId() {
        return handleUserId;
    }

    public void setHandleUserId(String handleUserId) {
        this.handleUserId = handleUserId;
    }

    public String getHandlereport() {
        return handlereport;
    }

    public void setHandlereport(String handlereport) {
        this.handlereport = handlereport;
    }

    public Boolean isDeletedFlag() {
        return deletedFlag;
    }

    public void setDeletedFlag(Boolean deletedFlag) {
        this.deletedFlag = deletedFlag;
    }

    public String getDeleterUserId() {
        return deleterUserId;
    }

    public void setDeleterUserId(String deleterUserId) {
        this.deleterUserId = deleterUserId;
    }

    public ZonedDateTime getDeletionTime() {
        return deletionTime;
    }

    public void setDeletionTime(ZonedDateTime deletionTime) {
        this.deletionTime = deletionTime;
    }

    public ZonedDateTime getLastModificationTime() {
        return lastModificationTime;
    }

    public void setLastModificationTime(ZonedDateTime lastModificationTime) {
        this.lastModificationTime = lastModificationTime;
    }

    public String getLastModifierUserId() {
        return lastModifierUserId;
    }

    public void setLastModifierUserId(String lastModifierUserId) {
        this.lastModifierUserId = lastModifierUserId;
    }

    public ZonedDateTime getCreationTime() {
        return creationTime;
    }

    public String getHandleUserName() {
        return handleUserName;
    }

    public void setHandleUserName(String handleUserName) {
        this.handleUserName = handleUserName;
    }

    public void setCreationTime(ZonedDateTime creationTime) {
        this.creationTime = creationTime;
    }

    public String getCreatorUserId() {
        return creatorUserId;
    }

    public void setCreatorUserId(String creatorUserId) {
        this.creatorUserId = creatorUserId;
    }

    public String getRouteCode() {
        return routeCode;
    }

    public void setRouteCode(String routeCode) {
        this.routeCode = routeCode;
    }

    public String getLaunchsiteName() {
        return launchsiteName;
    }

    public void setLaunchsiteName(String launchsiteName) {
        this.launchsiteName = launchsiteName;
    }

    public String getDestinationsiteName() {
        return destinationsiteName;
    }

    public void setDestinationsiteName(String destinationsiteName) {
        this.destinationsiteName = destinationsiteName;
    }

    public String getTransportCode() {
        return transportCode;
    }

    public void setTransportCode(String transportCode) {
        this.transportCode = transportCode;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        WarnInfoDTO warnInfoDTO = (WarnInfoDTO) o;
        if(warnInfoDTO.getId() == null || getId() == null) {
            return false;
        }
        return Objects.equals(getId(), warnInfoDTO.getId());
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(getId());
    }

    @Override
    public String toString() {
        return "WarnInfoDTO{" +
            "id=" + getId() +
            ", dispatchId='" + getDispatchId() + "'" +
            ", lockCode='" + getLockCode() + "'" +
            ", warnType='" + getWarnType() + "'" +
            ", msg='" + getMsg() + "'" +
            ", warnpostion='" + getWarnpostion() + "'" +
            ", warnTime='" + getWarnTime() + "'" +
            ", handleFlag='" + isHandleFlag() + "'" +
            ", noticestatus='" + getNoticestatus() + "'" +
            ", handleTime='" + getHandleTime() + "'" +
            ", handleUserId='" + getHandleUserId() + "'" +
            ", handlereport='" + getHandlereport() + "'" +
            ", deletedFlag='" + isDeletedFlag() + "'" +
            ", deleterUserId='" + getDeleterUserId() + "'" +
            ", deletionTime='" + getDeletionTime() + "'" +
            ", lastModificationTime='" + getLastModificationTime() + "'" +
            ", lastModifierUserId='" + getLastModifierUserId() + "'" +
            ", creationTime='" + getCreationTime() + "'" +
            ", creatorUserId='" + getCreatorUserId() + "'" +
            "}";
    }
}
